@prefix: ew-;

.@{prefix}select {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: rgba(0, 0, 0.85);
  font-size: 14px;
  font-variant: tabular-nums;
  line-height: 1.5715;
  font-feature-settings: 'tnum';
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 4px;
  min-width: 120px;

  &-disabled {
    .@{prefix}select-selector {
      background: #f5f5f5;
      cursor: not-allowed;
      color: rgba(0, 0, 0, 0.25);
    }

    .@{prefix}select-arrow {
      cursor: not-allowed;
    }
  }

  &:not(.@{prefix}select-disabled):hover &-selector,
  &:not(.@{prefix}select-disabled):active &-selector {
    border-color: #2396ef;
  }

  &-selector {
    position: relative;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 100%;
    height: 32px;
    padding: 0 11px;

    &&-placeholder::after {
      content: attr(placeholder);
      display: inline-block;
      padding-right: 18px;
      color: rgba(0, 0, 0, 0.35);
      position: relative;
      left: -15px;
    }

    &-value {
      padding-right: 18px;
      line-height: 30px;
      position: relative;
    }
  }

  &:not(.@{prefix}select-disabled):hover &-value {
    border-color: #2396ef;
    border-right-width: 1px;
  }

  &-arrow {
    display: inline-block;
    color: inherit;
    font-style: normal;
    line-height: 0;
    text-transform: none;
    vertical-align: -0.125em;
    text-rendering: optimizelegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: absolute;
    top: 50%;
    right: 11px;
    display: flex;
    align-items: center;
    margin-top: -6px;
    font-size: 12px;
    line-height: 1;
    text-align: center;

    &-icon,
    .@{prefix}select-clear-icon {
      width: 16px;
      height: 16px;
      display: inline-block;
      color: rgba(0, 0, 0, 0.25);
    }
  }

  .@{prefix}select-clear-icon {
    position: relative;
    top: -2px;
  }

  &-dropdown {
    margin: 0;
    color: rgba(0, 0, 0.85);
    font-variant: tabular-nums;
    line-height: 1.5715;
    position: absolute;
    z-index: 1050;
    box-sizing: border-box;
    padding: 4px 0;
    overflow: hidden;
    font-size: 14px;
    font-variant: initial;
    background-color: #fff;
    border-radius: 2px;
    outline: none;
    width: 100%;
    top: 40px;
    box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014,
      0 9px 28px 8px #0000000d;

    &-option {
      position: relative;
      display: flex;
      min-height: 32px;
      padding: 5px 12px;
      color: rgba(0, 0, 0.85);
      font-weight: 400;
      font-size: 14px;
      line-height: 22px;
      cursor: pointer;
      transition: background 0.3s ease;
      flex: auto;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;

      &-disabled {
        color: rgba(0, 0, 0, 0.25);
        cursor: not-allowed;
      }

      &:not(:last-of-type) {
        margin-bottom: 8px;
      }

      &:not(&-disabled):hover {
        background-color: #f5f5f5;
      }

      &:not(&-disabled).active {
        background-color: #e6f7ff;
      }
    }
  }
}
